from selenium import webdriver
from selenium.webdriver.common.by import By
from page_locators.login_page_locator import LoginPageLocator as LL

class LoginPage():
    def __init__(self,driver):
        self.driver = driver
        self.ll= LL()

    # username_loc = (By.XPATH, '//*[@id="username"]')
    # password_loc = (By.XPATH, '//*[@id="password"]')
    # ver_code_loc = (By.XPATH, '//*[@id="verify_code"]')
    # loginbtn_loc = (By.XPATH, '//*[@id="loginform"]/div/div[6]/a')


    def login(self,username,password,ver_code='1111'):
        self.driver.find_element(*self.ll.username_loc).send_keys(username)
        self.driver.find_element(*self.ll.password_loc).send_keys(password)
        self.driver.find_element(*self.ll.ver_code_loc).send_keys(ver_code)
        self.driver.find_element(*self.ll.loginbtn_loc).click()
